package com.shexianyu.notes.web.dto;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @author sxy
 * @version 1.0
 * @date 2021/2/26 17:06
 */
@Data
public class RegisterDTO {

    @NotBlank(message = "账号不能为空")
    private String account;

    //特殊字符需在“~@#$%*_-+=:,.?[]{}”范围内选择
    @Pattern(regexp = "^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~@#$%\\*-\\+=:,\\\\?\\[\\]\\{}]).{6,16}$"
            ,message = "密码为：6-16位字符，同时包括数字、大小写字母和特殊字符四种组合")
    private String password;

    @Pattern(regexp = "^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~@#$%\\*-\\+=:,\\\\?\\[\\]\\{}]).{6,16}$"
            ,message = "密码为：6-16位字符，同时包括数字、大小写字母和特殊字符四种组合")
    private String repeatPassword;

    @NotBlank(message = "用户名不能为空")
    private String username;
}
